//Page Object
import request from '../../request/request.js'
Page({
  data: {
    swiperList: [],
    cateList:[],
    floorList:[]
  },
  //options(Object)
  onLoad: function (options) {
    // wx.request({
    //   url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
    //   success: (result) => {
    //     console.log(result);
    //        this.setData({
    //         swiperList:result.data.message
    //        })
    //        },
    // });
    request({
        url: 'home/swiperdata'
      })
      .then(result => {
        // console.log(result);
        this.setData({
          swiperList: result
        })
      })

      request({
        url: 'home/catitems'
      })
      .then(result => {
        // console.log(result);
        this.setData({
          cateList: result
        })
      })

      request({
        url: 'home/floordata'
      })
      .then(result => {
        // console.log(result);
        this.setData({
          floorList: result
        })
      })


  },
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  },
  onPageScroll: function () {

  },
  //item(index,pagePath,text)
  onTabItemTap: function (item) {

  }
});






// index
// category
// goods_list
// goods_detail
// cart
// collect
// order
// search
// user
// feedback
// login
// auth
// pay